﻿<%@ WebHandler Language="C#" Class="CartDeleteAll" %>

using System;
using System.Web;
using Newtonsoft.Json;

public class CartDeleteAll : IHttpHandler, System.Web.SessionState.IReadOnlySessionState
{
    
    public void ProcessRequest (HttpContext context) {
        OTS.Common.PageSuccess page = new OTS.Common.PageSuccess();
 
        if (context.Session["custom"] == null )
        {
            page.success = false;
            page.msg = "非法操作！";

        }
        else
        { 
            OTS.Model.custom custom = (OTS.Model.custom)context.Session["custom"];
            OTS.BLL.CartBLL bll = new OTS.BLL.CartBLL();
            bll.DeleteAll(custom.cusID);
            page.success = true;
            page.msg = "删除成功！";
             
        }

        context.Response.ContentType = "application/x-json";
        context.Response.Charset = "utf-8";
        context.Response.Write(JavaScriptConvert.SerializeObject(page));
    }
 
    public bool IsReusable {
        get {
            return false;
        }
    }

}